package generator

import "beergo/plugins/maker"

func init() {
	Task()
	Service()
}

func Task() {
	c := maker.CreateTable("Task","需求任务","check")
	c.AddManyToOne("user","所属用户","sys.User").SetSrcDir("sys")
	c.AddText("cover","封面图")
	c.AddText("name","样品名称")
	c.AddArt("info","样品描述")
	c.AddManyToOne("category","分类","Category")
	c.AddManyToOne("group","服务类型","ServiceGroup")

	c.AddJson("pics","样品图片")//暂未使用
	c.AddText("area","样品所在")
	c.AddText("areaCheck","期望检测地")
	c.AddText("term","期望周期")
	c.AddText("phone","手机号")
	c.AddText("contact","联系人及职务")
	c.AddText("company","企业名称")
	c.AddText("fromType","送检类型")
	c.AddText("budget","预算")
	c.AddText("address","详细地址")
	c.AddFloat("lat","LAT")
	c.AddFloat("lng","LNG")
	c.AddCreateAt()

	c.Generate()
}

func Service (){
	c := maker.CreateTable("Service","服务","check")
	c.AddManyToOne("org","所属公司","Org").SetNullable(true)
	c.AddManyToOne("category","分类","Category")
	c.AddManyToOne("group","服务类型","ServiceGroup")
	//c.AddText("org","企业")
	c.AddText("price","服务费用")
	c.AddText("cover","封面图")
	c.AddText("name","服务名称")
	c.AddText("term","期望周期")
	c.AddText("deliver","送样方式")
	c.AddArt("info","服务详情")
	c.AddText("address","详细地址")
	c.AddFloat("lat","LAT")
	c.AddFloat("lng","LNG")

	c.AddCreateAt()
	c.AddDelete()

	c.Generate()
}